﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntityModule;

namespace Sport
{
    public partial class NewsDetail1 : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid guid = Request.QueryString["ID"].AsGuid();
            List<NewsDetail> list = Service.NewsDetails.Where(s => s.NewID == guid).ToList();
            foreach (NewsDetail newsDetail in list)
            {
                string body = newsDetail.Body;
                if (newsDetail.New.UserID == null)
                {
                    body = HtmlHelper.RemoveTagClss("div", "list_share_icon", body);
                    body = HtmlHelper.RemoveTagClss("div", "box_news_bottom_detail left w480 title_releated", body);
                    body = HtmlHelper.RemoveTagClss("div", "txt_block_news_detail", body);
                    body = HtmlHelper.RemoveTagClss("div", "block_scrooll", body);
                    body = HtmlHelper.RemoveTagClss("li", "fb_like", body);
                    body = HtmlHelper.RemoveTagClss("div", "content_tagbar", body);
                    body = HtmlHelper.RemoveTagClss("ul", "left", body);
                    body = body.Replace("<li></li>", "");
                    body = body.RemoveTag("iframe");
                    body = body.SetStyleTag("img", "width:480px");
                    body = body.SetStyleTag("p", "Normal", "padding-right:15px");
                    body = body.SetStyleTag("p", "short_intro", "padding-right:15px");
                    body = body.SetStyleTag("div", "time txt_666 left txt_11", "padding-top:10px");
                }
                newsDetail.LinkCurrentPage = HttpContext.Current.Request.Url.AbsoluteUri;
                newsDetail.Body = body;
            }
            rptCustomers.DataSource = list;
            rptCustomers.DataBind();
        }
    }
}